import {ADD_TODO} from './mutation-type'

export  default {
  [ADD_TODO] (state,todo){
    state.todos.unshift(todo)
  },
  delTodo(state,index){
    state.todos.splice(index,1);
  },
  clearComplete(state){
    state.todos = state.todos.filter(todo=>!todo.complete)
  }
}
